import 'ant-design-vue/dist/antd.css';
import './design/index.less';

import { createApp } from 'vue';
import App from './App.vue';
import { router, setupRouter } from './router';
import Antd from 'ant-design-vue';


import { setupErrorHandle } from '@/logics/error-handle';
import { initAppConfigStore } from '@/logics/initAppConfig';
import { setupStore } from '@/stores';
import { setupI18n } from '@/locales/setupI18n';

async function boot() {
  const app = createApp(App);
  // 配置 store
  setupStore(app);

  // 初始化内部系统配置
  initAppConfigStore();

  // 多语言配置
  // 异步案例：语言文件可能从服务器端获取
  await setupI18n(app);

  // 配置路由
  setupRouter(app);

  // 配置全局错误处理
  setupErrorHandle(app);

  app.use(Antd);// 全量引入

  app.mount('#app');
}

boot();
